package demo;

import java.util.Arrays;

public class StringDemo01 {
    public static void main(String[] args) {
        String str = "开发喵";    //字面量
        System.out.println(str);
        String str1 = new String("开发喵");    //字符串对象
        System.out.println(str1);

        String season = """
                winter""";     //winter后不换行，要是“”“写到下一行会换行
        System.out.println(season);

        String period = """
                winter
                abc        //abc后换行，再输出下一行
                """;
        System.out.println(period);

        String greeting = """
                Hi,"Bob"      //同一行输出
                """;
        System.out.println(greeting);
        String greeting1 = """
                Hi, "Bob"      // "Bob"前有空格，输出语句里也有一个空格
                """;
        System.out.println(greeting1);


        String salutation = """
                Hi,           //分开输出
                "Bob"
                """;
        System.out.println(salutation);
        String salutation1 = """
                Hi,           
                 "Bob"       // "Bob"前有空格，输出语句里也有一个空格
                """;
        System.out.println(salutation1);

        String empty = """
                """;
        System.out.println(empty);
        String quote = """
                "
                """;
        System.out.println(quote);

        String backslash = """
                \\      //转义只输出一个/
                """;
        System.out.println(backslash);



    }
}
